package au.com.handsunited.web.controller.group;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

import au.com.handsunited.service.GroupService;
import au.com.handsunited.web.command.group.InviteGroupCommand;

/**
 * @author arunda
 *
 */
public class InviteGroupController extends SimpleFormController {

	private GroupService groupService;


	private static Logger logger = LoggerFactory.getLogger(InviteGroupController.class);

	/**
	 *
	 */
	public InviteGroupController() {
		setCommandClass(InviteGroupCommand.class);
	}



	/**
	 * @see org.springframework.web.servlet.mvc.SimpleFormController#onSubmit(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException)
	 */
	@Override
	protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {

		InviteGroupCommand inviteGroupCommand = (InviteGroupCommand) command;

		Map<String, String> model = new HashMap<String, String>();

		ModelAndView mav = new ModelAndView(getSuccessView(), model);

		return mav;
	}


	/**
	 * @param groupService the groupService to set
	 */
	public void setGroupService(GroupService groupService) {
		this.groupService = groupService;
	}

}

